#!/usr/bin/python
# -*- coding: utf-8 -*-

import Ice, sys, os
import AMSI, DFI, MTSI, AgentFactoryI, AgentI, PropertyServiceI
from AMSI import *
from DFI import *
from MTSI import *
from AgentFactoryI import *
from AgentI import *
from PropertyServiceI import *

class FIPAServer (Ice.Application):

    def run (self, argv):
        self.shutdownOnInterrupt()
        adapter = self.communicator().createObjectAdapter('FIPAServicesAdapter')
        adapter.activate()
        adapter.add(AMSI('MyPlatform'),
                    self.communicator().stringToIdentity('AMS'))
        adapter.add(DFI(adapter),
                    self.communicator().stringToIdentity('DF'))
        adapter.add(MTSI(),
                    self.communicator().stringToIdentity('MTS'))
        self.communicator().waitForShutdown()

        return 0

FIPAServer().main(sys.argv)
